home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10955 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  43 lines

  1. Newsgroups: comp.lang.c++
  2. Path: id.dtu.dk!news!jl
  3. From: jl@id.dth.dk (J°rn Lind-Nielsen)
  4. Subject: Re: Major problem with strings.
  5. In-Reply-To: rmorin@inforamp.net's message of Mon, 11 Mar 96 06:20:01 GMT
  6. Message-ID: <JL.96Mar11162442@thyme.id.dth.dk>
  7. Sender: news@id.dtu.dk (NetNews)
  8. Organization: Department of Computer Science, The Technical University of
  9.     Denmark
  10. References: <31438275.72DB@aol2.com> <4i0gn0$5g9@sam.inforamp.net>
  11. Date: Mon, 11 Mar 1996 21:24:42 GMT
  12.  
  13.  
  14. In article <4i0gn0$5g9@sam.inforamp.net> rmorin@inforamp.net (Randy Charles Morin) writes:
  15.  
  16.    In article <31438275.72DB@aol2.com>, Neil <neil@aol2.com> wrote:
  17.    >1    char *club="";
  18.    >2    club="/public_html/neil";
  19.    >3    strcat(club,argv[1]+5);
  20.    >4    strcat(club,"/");
  21.  
  22.    No, this just won't do.  When you want a '/' slash in C, use two slashes.
  23.    The '/' is also used to denote an escape sequence (for special characters).
  24.    Thus your code should read...
  25.  
  26.    1    char *club="";
  27.    2    club="//public_html//neil";
  28.    3    strcat(club,argv[1]+5);
  29.    4    strcat(club,"//");
  30.  
  31.  
  32.  
  33. Now come on .. Do you want a slash or a backslash ???  And it still won't do
  34. any good. There just ain't room for the additional argv[] characters! You will
  35. have to allocate some room for it - somewhere.
  36. --
  37. ------------------------------------------------------------------------
  38. From:    Jorn Bo Lind-Nielsen     /"""\    Bergsoe Kollegiet 2104
  39. E-mail:  jl@it.dtu.dk             |o o|    DK - 2850 Naerum
  40. --------------------------------ooo-U-ooo-------------------------------
  41. A Norton Commander for Unix ?              FTP duroc.ds-data.dk /pub/uc
  42. ------------------------------------------------------------------------
  43.